This tutorial introduces Magicodes.IE.Excel already supports merged row cell import.
Install-Package Magicodes.IE.ExcelThe reference sample code is shown below.
public class MergeRowsImportDto
{
[ImporterHeader(Name = "学号")]
public long No { get; set; }
[ImporterHeader(Name = "姓名")]
public string Name { get; set; }
[ImporterHeader(Name = "性别")]
public string Sex { get; set; }
}As shown below:
This file can be found in the test project.
Importing the code is no different from other normal import codes.
var filePath = Path.Combine(Directory.GetCurrentDirectory(), "TestFiles", "Import", "合并行.xlsx");
var import = await Importer.Import<MergeRowsImportDto>(filePath);The above code can be found in the unit test MergeRowsImportTest. After debugging and running, you can see the following figure.
This tutorial ends here, if you have questions, please submit more Issue.
Magicodes.IE:导入导出通用库,支持Dto导入导出、模板导出、花式导出以及动态导出,支持Excel、Csv、Word、Pdf和Html。
- Github:https://github.com/dotnetcore/Magicodes.IE
- gitee(Manual sync, no maintenance):https://gitee.com/magicodes/Magicodes.IE

